<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>修改class</title>
		<style type="text/css">
			div{
				width: 200px;
				height: 200px;
				border: 2px solid red;
			}
			.huang{
				background: yellowgreen;
			}
		</style>
		<script type="text/javascript">
			function change(){
				document.getElementById('box').className="huang";
			}
			function meiyou(){
				document.getElementById("box").className=" ";
			}
		</script>
	</head>
	<body>
		<input type="button" value="点击变色" onclick="change()"/>
		<input type="button" value="点击没有" onclick="meiyou()"/>
		<div id="box"></div>
	</body>
</html>
